#include "DTOEquipment.h"

DTOEquipment::DTOEquipment(BonusType bonusType,int value,std::string owner)
:DTO(EQUIPMENT_STATUS,owner){
	this->bonusType = bonusType;
	this->value = value;
}

DTOEquipment::DTOEquipment(std::string& aDeserealizar, std::string owner) :
		DTO(EQUIPMENT_STATUS, owner) {
	deserializar(aDeserealizar, owner);
}

std::string DTOEquipment::serializar(){
	std::stringstream retorno;

	retorno << UtilString::TOlenghtStringStringValue(bonusType);
	retorno << UtilString::TOlenghtStringStringValue(value);

	return retorno.str();
}

void DTOEquipment::deserializar(std::string& string,std::string owner){
	bonusType = (BonusType)UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
	value = UtilString::stringToInt(UtilString::FROMlenghtStringStringValue(string));
}
